package com.ph.irp.stock.service;

import java.util.List;
import java.util.Map;

import com.ph.irp.dto.StockOrderDTO;
import com.ph.irp.dto.StockOrderDetailDTO;
import com.ph.irp.model.PStockOrderdetail;
import com.ph.irp.model.PStockOrder;

public interface StockOrderService {
	
	/**
	 * 新增采购订单及明细
	 * @param stockOrder采购订单model
	 * @param stockOrderDetails采购订单明细model
	 * @throws Throwable 抛出异常
	 */
	
	void addStockOrder(PStockOrder stockOrder,List<PStockOrderdetail> stockOrderDetails)throws Throwable ;
	/**
	 * 修改采购订单及明细
	 * @param stockOrder 采购订单model
	 * @param stockOrderDetails 和采购订单对应的明细
	 * @throws Throwable 抛出异常
	 */
	void editStockOrder(PStockOrder stockOrder,List<PStockOrderdetail> stockOrderDetails)throws Throwable;
	/**
	 * 根据采购订单id删除采购订单，可删除多条
	 * @param stockOrderIds 采购订单id
	 * @throws Throwable 抛出异常
	 */
	void deleteStockOrder(String stockOrderIds)throws Throwable;
	/**
	 * 查询所有的采购订单
	 * @return
	 * @throws Throwable
	 */
	List<StockOrderDTO> getAllStockOrders()throws Throwable ;
	/**
	 * 动态查询采购订单
	 * @param stockOrderModel 封装有查询条件的采购订单model
	 * @param startDate 起始时间
	 * @param endDate 截止时间
	 * @return 返回采购订单dtos
	 * @throws Throwable
	 */
	List<StockOrderDTO> getStockOrdersByCondition(PStockOrder stockOrderModel,String startDate,String endDate)throws Throwable;
	/**
	 * 根据采购订单id返回采购订单dto及其明细dto的信息
	 * @param stockOrderId 采购订单id
	 * @return 返回装有采购订单dto和其明细的dtos
	 */
	Map<StockOrderDTO,List<StockOrderDetailDTO>>getStockOrderById(int stockOrderId)throws Throwable;

}
